//
//  UILabel+Extension.swift
//  MicroBlog
//
//  Created by  NorthCity on 15/11/5.
//  Copyright © 2015年  NorthCity. All rights reserved.
//

import UIKit

extension UILabel{
    ///便利构造方法
    
    convenience init(title:String,fontSize:CGFloat = 14, color:UIColor = UIColor.darkGrayColor(),screenInsert:CGFloat = 0){
        self.init()
        self.text = title
        self.textColor = color
        self.font = UIFont.systemFontOfSize(fontSize)
        self.numberOfLines = 0
        if screenInsert > 0 {
         self.preferredMaxLayoutWidth = UIScreen.mainScreen().bounds.width - 2 * screenInsert
         self.textAlignment = .Left
        }else{
        self.textAlignment = NSTextAlignment.Center
        }
    }
}
